/*
 * @Description  :
 * @Autor        : guoxi
 * @Date         : 2022-08-14 10:29:08
 * @LastEditors  : Please set LastEditors
 * @LastEditTime : 2022-09-09 18:26:56
 * @FilePath     : \rpms\src\api\funds.ts
 */
import http from "../utils/http/service";

export const importFundForProject = (data): any => {
  return http.post("/rdms-admin/fee/budget/import", data);
};
export const saveFundForProject = (data): any => {
  return http.post("/rdms-admin/fee/budget/save", data);
};
export const getFundForProject = (id): any => {
  return http.post("/rdms-admin/fee/budget/detail/" + id);
};

export const getFundList = (data): any => {
  return http.post("/rdms-admin/fee/input/list", data);
};

//经费支出
export const getFeeSpendList = (data): any => {
  return http.post("/rdms-admin/RdFeeSpendDetail/list", data);
};
export const addFeeSpend = (data): any => {
  return http.post("/rdms-admin/RdFeeSpendDetail/add", data);
};
export const updateFeeSpend = (data): any => {
  return http.post("/rdms-admin/RdFeeSpendDetail/update", data);
};
export const delFeeSpend = (id): any => {
  return http.post("/rdms-admin/RdFeeSpendDetail/delete/" + id);
};
export const approveFeeSpend = (id): any => {
  return http.post("/rdms-admin/RdFeeSpendDetail/approve/" + id);
};
export const rejectFeeSpend = (id): any => {
  return http.post("/rdms-admin/RdFeeSpendDetail/reject/" + id);
};

//费用填报

export const getInputFundsList = (data): any => {
  return http.post("/rdms-admin/fee/input/list", data);
};
export const delInputFunds = (data): any => {
  return http.post("/rdms-admin/fee/input/delete", data);
};
export const addYearForFunds = (data): any => {
  return http.post("/rdms-admin/fee/input/year/add", data);
};
export const updateYearForFunds = (data): any => {
  return http.post("/rdms-admin/fee/input/year/update", data);
};
export const importMonthForFunds = (data): any => {
  return http.post("/rdms-admin/fee/spend/month/import", data);
};
export const importYearForFunds = (data): any => {
  return http.post("/rdms-admin/fee/spend/year/import", data);
};

export const saveMonthForFunds = (data): any => {
  return http.post("/rdms-admin/fee/spend/month/save", data);
};
export const saveYearForFunds = (data): any => {
  return http.post("/rdms-admin/fee/spend/year/save", data);
};

export const updateMonthForFunds = (data): any => {
  return http.post("/rdms-admin/fee/spend/month/update", data);
};

export const getHistoryForFunds = (dateStr): any => {
  return http.post("/rdms-admin/fee/history/month/statistics/" + dateStr);
};
export const getHistoryForFunds2 = (dateStr): any => {
  return http.post(
    "/rdms-admin/fee/history/month/carryout/statistics/" + dateStr
  );
};

// 非项目模块接口

export const getFeeOtherSpendList = (data): any => {
  return http.post("/rdms-admin/RdFeeOtherSpend/list", data);
};
export const addFeeOtherSpend = (data): any => {
  return http.post("/rdms-admin/RdFeeOtherSpend/add", data);
};
export const updateFeeOtherSpend = (data): any => {
  return http.post("/rdms-admin/RdFeeOtherSpend/update", data);
};
export const delFeeOtherSpend = (id): any => {
  return http.post(`/rdms-admin/RdFeeOtherSpend/delete/${id}`);
};
export const getFeeOtherSpend = (data): any => {
  return http.post(`/rdms-admin/RdFeeOtherSpend/detail/${data.id}`);
};

// 科研经费汇总
export const getFeeSummary = (data): any => {
  return http.post(`/rdms-admin/fee/summary/statistics/${data}`);
};

export const getFeeYears = (): any => {
  return http.post(`/rdms-admin/fee/summary/years`);
};

// 填报费用查看
export const getInputDetail = (data): any => {
  return http.post(`/rdms-admin/fee/input/detail`, data);
};

// 审核
export const getInputApprove = (data): any => {
  return http.post(`/rdms-admin/fee/approve/${data.id}`);
};

// 驳回
export const getInputReject = (data): any => {
  return http.post(`/rdms-admin/fee/reject/${data.id}`);
};

// 废止
export const getAbolish = (data): any => {
  return http.post(`/rdms-admin/fee/abolish/${data.id}`);
};

// 查看项目预算执行表
export const getBudgetDetail = (data): any => {
  return http.post(`/rdms-admin/fee/budget/carryout/detail/${data}`);
};

export const getFeeProjectList = (data): any => {
  return http.post(`/rdms-admin/rdProject/fee/projectList`, data);
};

export const getMonthStatistics = (yaer): any => {
  return http.post(`/rdms-admin/fee/summary/statisticsMonth/${yaer}`);
}
export const getYearStatistics = (yaer): any => {
  return http.post(`/rdms-admin/fee/budget/annual/summary/${yaer}`);
}
